subroutine EVu(n7,n8,riskret,sav,iy1,tty,gcash,ncash,ninc,V,secd,nweig1b,survprob,rho,auxVV)
INTEGER, INTENT(IN) :: ncash,ninc,n7,n8
REAL, INTENT(IN) :: sav, survprob, rho
REAL, INTENT(IN) :: riskret(n8,1), V(ncash,ninc,n7), secd(ncash,ninc,n7), nweig1b(n7,n8)!, yh(n7,1)
REAL, INTENT(IN) :: gcash(ncash,1), tty
INTEGER, INTENT(IN) :: iy1
double precision, INTENT(OUT) :: auxVV
double precision :: int_V1, int_V2, int_V
INTEGER :: i6,i7,i8,iy
real :: cash_1
  
auxVV=0.0
do i8=1,n8
   do i7=1,n7
      cash_1= riskret(i8,1)*sav 
      cash_1 = max(min(cash_1,gcash(ncash,1)),gcash(1,1))
      call sc_splint(gcash(:,1),V(:,iy1,i7),secd(:,iy1,i7),ncash,cash_1,int_V1)
      call sc_splint(gcash(:,1),V(:,iy1+1,i7),secd(:,iy1+1,i7),ncash,cash_1,int_V2)
      int_V = (1-tty)*int_V1+tty*int_V2                 
      auxVV=auxVV+nweig1b(i7,i8)*survprob*(int_V**(1.0-rho))
   end do   !i8
end do      !i7

end subroutine
